![]() Acrobat file (144K) |
![]() ClarisWorks 4 file (41K) |
![]() not available yet |
TECHNOTE 1027 | FEBRUARY 1996 |
Although the Macintosh printing architecture has only two major flavors -- QuickDraw GX and traditional, Print Manager printing -- many applications just can't seem to get printing right. (No fingers pointed here: you know who you are). For example, some apps require a specific driver in order to print correctly; other apps assume that certain undocumented APIs and structures will remain constant across different versions of printer drivers. (There's a reason we don't document LaserPrep, or how a driver uses the fields within PrintX).
This Technote provides you with a few, important guidelines to alert you to problem printing areas, and to help you test your application. If your application is guilty of breaking the rules, you should at least think about fixing the incompatibilities, since there will only be more change in the future.
Things to look for:
LaserWriter 8.4 will again support one-pass printing when it is released, so you should test with LaserWriter 7 with background printing off, and also with LaserWriter 8 to ensure the best compatibility with both printing methods.
There are two common mistakes applications make here. One is not handling errors correctly when a spooling print driver runs out of disk space (don't just put up an alert saying "Printing Error Code 575789390," use a descriptive message), and the other is depending on the driver somehow mystically divining what you really mean and doing the right thing as it optimizes your print job. This last falls into the category of depending on the specific behavior of a driver, but it's often unintentional.
An example is an application that "knows" that the LaserWriter driver will make a font available in PostScript if you print any character in that font, so the application will print a space character, and then ask for the font via PostScript. One problem is that the driver may not send the complete font when all you ask for is a space character. Another is that the driver may decide to name the font it sends something other than what you expect.
A lot of apps make the mistake of calling PrintDefault() with a closed driver. Although recent Apple QuickDraw drivers and the LaserWriter 8.4 driver are "smart" about this, older drivers still in use (such as LaserWriter 8.2.3f, LaserWriter 8.3.x, and Color StyleWriter Pro) are not. Inside Macintosh: Imaging with QuickDraw is vague on this point. In Chapter 9, the general sections maintain that the app must call PrOpen() before making any Print Manager calls, but the reference for PrintDefault() doesn't say explicitly that apps must call PrOpen() first. The documentation for all other functions states explicitly that PrOpen() is a necessary call.
The solution is to wrap calls to PrDefault with PrOpen-PrClose.
The solution is to check your errors and handle them gracefully.
Note: This Technote will be revised and updated as new drivers come out and we move closer to Copland.
Return to Technotes Table of Contents
Return to About Macintosh Technotes
Return to Developer Services and Products
Send feedback to devfeedback@applelink.apple.com.
[last modified by fch on 28-Feb-96]